// $(function() {
  //数据交换
  function getvalue(name) {
    var str = window.location.search; //location.search是从当前URL的?号开始的字符串
    if (str.indexOf(name) != -1) {
      var pos_start = str.indexOf(name) + name.length + 1;
      var pos_end = str.indexOf("&", pos_start);
      if (pos_end == -1) {
        return decodeURIComponent(str.substring(pos_start));
      } else {
        alert("没有此值~~");
      }
    }
  }
  var keyword = getvalue("keyword");
  alert("要执行ajax了")
  var jsonData = {
    "keyword": keyword
  }
  $.ajax({
    type: "post",
    url: "./handler/show_info.php",
    dataType: "json",
    data: jsonData,
    success: function(msg) {
      // alert(typeof(msg));
      // alert(msg.Course_Name); 
      alert("ajax success");
      alert(msg.objectArray[0].Course_Name);
      // for(var i = 0 ; i< msg.objectArray.length;i++){
      $(".enable_edit").find('.price').html(msg.objectArray[0].Price);
      $(".enable_edit").find('.goods_name').html(msg.objectArray[0].Course_Name);
      $(".enable_edit").find('.goods_kind').html(msg.objectArray[0].Kind);

      // } 
    }
  });

  //to-top
  $(window).on("scroll",function(){
      if($(window).scrollTop()>350){
        $(".to-top").show();
      }else{
        $(".to-top").hide();
      }
    })
    $(".to-top").on("mouseenter",function(){
      $(this).find("img").attr("src","./src/common/top2.png");
    })
    $(".to-top").on("mouseleave",function(){
      $(this).find("img").attr("src","./src/common/top1.png");
    })

})